/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Modele;

import java.util.Collection;
import java.util.HashSet;
import java.util.TreeSet;

/**
 *
 * @author sio
 */
public class Pays {
    private Collection <Dep> lesDeps ;
    private Collection <Specialite> lesSpe;
    
    public Pays(){
        lesSpe=DAO.getlesSpe();
        lesDeps=DAO.getLesDeps();
        Collection <Med> colM =DAO.getlesMed();
         
        for(Med unM : colM){
            
            for (Specialite s : lesSpe){
                
                if(s.getNom().equals(unM.getSpe())){
                    s.addM(unM);
                }
            }
            for (Dep d : lesDeps){
                if(d.getNum().equals(unM.getDep())){
                    d.addM(unM);
                }
            }
            
        }
        
    }
    public Collection <Dep> getLesDeps(){
        return lesDeps;
    }
    public Collection <Specialite> getLesspe(){
        return lesSpe;
    }
    public Dep getLeDep(String num){
        for(Dep d : lesDeps){
            if(d.getNum().equals(num)){
                
                return d;
            }
        }
        return null;
    }

    /**
     *
     * @param num
     * @return
     */
    public Specialite getLaSpe(String nom){
        for(Specialite s : lesSpe){
            if(s.getNom().equals(nom)){
                
                return s;
            }
        }
        return null;
    }
}
